package cn.wzut.edut.dao.inf;

import cn.wzut.edut.dao.SnowflakeIdWorker;
import cn.wzut.edut.dao.mapper.*;
import cn.wzut.edut.dao.pojo.table.*;
import com.alibaba.excel.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 考试模块
 */
@Repository
public class Exam {
    @Autowired
    private ExmExamMapper exmExamMapper;
    @Autowired
    private ExmExamPaperMapper exmExamPaperMapper;
    @Autowired
    private ExmExamPaperItemMapper exmExamPaperItemMapper;
    @Autowired
    private ExmExamPermissionRelMapper exmExamPermissionRelMapper;
    @Autowired
    private ExmStuPaperItemMapper exmStuPaperItemMapper;
    @Autowired
    private ExmStuPaperRelMapper exmStuPaperRelMapper;
    /**
     * ===================================================================================================
     * 基础查询
     * ===================================================================================================
     */

    /**
     * 查询考试信息
     */
    public List<ExmExam> selectExmExam(String id,String exam_name,String subject,String create_id,String create_time,String start_time,String end_time,String exam_type,String exam_precaution,String del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_name),"exam_name",exam_name);
        queryWrapper.in(!StringUtils.isEmpty(subject),"subject",subject);
        queryWrapper.in(!StringUtils.isEmpty(create_id),"create_id",create_id);
        queryWrapper.in(!StringUtils.isEmpty(create_time),"create_time",create_time);
        queryWrapper.in(!StringUtils.isEmpty(start_time),"start_time",start_time);
        queryWrapper.in(!StringUtils.isEmpty(end_time),"end_time",end_time);
        queryWrapper.in(!StringUtils.isEmpty(exam_type),"exam_type",exam_type);
        queryWrapper.in(!StringUtils.isEmpty(exam_precaution),"exam_precaution",exam_precaution);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamMapper.selectList(queryWrapper);
    }
    /**
     * 查询考试信息数量
     */
    public long countExmExam(String id,String exam_name,String subject,String create_id,String create_time,String start_time,String end_time,String exam_type,String exam_precaution,String del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_name),"exam_name",exam_name);
        queryWrapper.in(!StringUtils.isEmpty(subject),"subject",subject);
        queryWrapper.in(!StringUtils.isEmpty(create_id),"create_id",create_id);
        queryWrapper.in(!StringUtils.isEmpty(create_time),"create_time",create_time);
        queryWrapper.in(!StringUtils.isEmpty(start_time),"start_time",start_time);
        queryWrapper.in(!StringUtils.isEmpty(end_time),"end_time",end_time);
        queryWrapper.in(!StringUtils.isEmpty(exam_type),"exam_type",exam_type);
        queryWrapper.in(!StringUtils.isEmpty(exam_precaution),"exam_precaution",exam_precaution);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamMapper.selectCount(queryWrapper);
    }
    /**
     * 查询考试信息
     * 分页
     */
    public List<ExmExam> selectExmExamPage(String id,String exam_name,String subject,String create_id,String create_time,String start_time,String end_time,String exam_type,String exam_precaution,String del_flag,long current,long size){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_name),"exam_name",exam_name);
        queryWrapper.in(!StringUtils.isEmpty(subject),"subject",subject);
        queryWrapper.in(!StringUtils.isEmpty(create_id),"create_id",create_id);
        queryWrapper.in(!StringUtils.isEmpty(create_time),"create_time",create_time);
        queryWrapper.in(!StringUtils.isEmpty(start_time),"start_time",start_time);
        queryWrapper.in(!StringUtils.isEmpty(end_time),"end_time",end_time);
        queryWrapper.in(!StringUtils.isEmpty(exam_type),"exam_type",exam_type);
        queryWrapper.in(!StringUtils.isEmpty(exam_precaution),"exam_precaution",exam_precaution);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamMapper.selectPage(new Page<ExmExam>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询考试信息
     * 列表查询
     */
    public List<ExmExam> selectExmExamList(List<String> id,List<String> exam_name,List<String> subject,List<String> create_id,List<String> create_time,List<String> start_time,List<String> end_time,List<String> exam_type,List<String> exam_precaution,List<String> del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_name!=null,"exam_name",exam_name);
        queryWrapper.in(subject!=null,"subject",subject);
        queryWrapper.in(create_id!=null,"create_id",create_id);
        queryWrapper.in(create_time!=null,"create_time",create_time);
        queryWrapper.in(start_time!=null,"start_time",start_time);
        queryWrapper.in(end_time!=null,"end_time",end_time);
        queryWrapper.in(exam_type!=null,"exam_type",exam_type);
        queryWrapper.in(exam_precaution!=null,"exam_precaution",exam_precaution);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamMapper.selectList(queryWrapper);
    }
    /**
     * 查询考试信息数量
     * 列表查询
     */
    public long countExmExamList(List<String> id,List<String> exam_name,List<String> subject,List<String> create_id,List<String> create_time,List<String> start_time,List<String> end_time,List<String> exam_type,List<String> exam_precaution,List<String> del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_name!=null,"exam_name",exam_name);
        queryWrapper.in(subject!=null,"subject",subject);
        queryWrapper.in(create_id!=null,"create_id",create_id);
        queryWrapper.in(create_time!=null,"create_time",create_time);
        queryWrapper.in(start_time!=null,"start_time",start_time);
        queryWrapper.in(end_time!=null,"end_time",end_time);
        queryWrapper.in(exam_type!=null,"exam_type",exam_type);
        queryWrapper.in(exam_precaution!=null,"exam_precaution",exam_precaution);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamMapper.selectCount(queryWrapper);
    }
    /**
     * 查询考试信息
     * 列表查询
     * 分页
     */
    public List<ExmExam> selectExmExamListPage(List<String> id,List<String> exam_name,List<String> subject,List<String> create_id,List<String> create_time,List<String> start_time,List<String> end_time,List<String> exam_type,List<String> exam_precaution,List<String> del_flag,long current,long size){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_name!=null,"exam_name",exam_name);
        queryWrapper.in(subject!=null,"subject",subject);
        queryWrapper.in(create_id!=null,"create_id",create_id);
        queryWrapper.in(create_time!=null,"create_time",create_time);
        queryWrapper.in(start_time!=null,"start_time",start_time);
        queryWrapper.in(end_time!=null,"end_time",end_time);
        queryWrapper.in(exam_type!=null,"exam_type",exam_type);
        queryWrapper.in(exam_precaution!=null,"exam_precaution",exam_precaution);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamMapper.selectPage(new Page<ExmExam>(current,size),queryWrapper).getRecords();
    }



    /**
     * 查询试卷信息
     */
    public List<ExmExamPaper> selectExmExamPaper(String id,String exam_id,String paper_name,String del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(paper_name),"paper_name",paper_name);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamPaperMapper.selectList(queryWrapper);
    }
    /**
     * 查询试卷信息数量
     */
    public long countExmExamPaper(String id,String exam_id,String paper_name,String del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(paper_name),"paper_name",paper_name);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamPaperMapper.selectCount(queryWrapper);
    }
    /**
     * 查询试卷信息
     * 分页
     */
    public List<ExmExamPaper> selectExmExamPaperPage(String id,String exam_id,String paper_name,String del_flag,long current,long size){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(paper_name),"paper_name",paper_name);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        return exmExamPaperMapper.selectPage(new Page<ExmExamPaper>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询试卷信息
     * 列表查询
     */
    public List<ExmExamPaper> selectExmExamPaperList(List<String> id,List<String> exam_id,List<String> paper_name,List<String> del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(paper_name!=null,"paper_name",paper_name);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamPaperMapper.selectList(queryWrapper);
    }
    /**
     * 查询试卷信息数量
     * 列表查询
     */
    public long countExmExamPaperList(List<String> id,List<String> exam_id,List<String> paper_name,List<String> del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(paper_name!=null,"paper_name",paper_name);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamPaperMapper.selectCount(queryWrapper);
    }
    /**
     * 查询试卷信息
     * 列表查询
     * 分页
     */
    public List<ExmExamPaper> selectExmExamPaperListPage(List<String> id, List<String> exam_id, List<String> paper_name, List<String> del_flag, long current, long size){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(paper_name!=null,"paper_name",paper_name);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        return exmExamPaperMapper.selectPage(new Page<ExmExamPaper>(current,size),queryWrapper).getRecords();
    }




    /**
     * 查询试卷题目信息
     */
    public List<ExmExamPaperItem> selectExmExamPaperItem(String id,String paper_id,String item_id,String grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        return exmExamPaperItemMapper.selectList(queryWrapper);
    }
    /**
     * 查询试卷题目信息数量
     */
    public long countExmExamPaperItem(String id,String paper_id,String item_id,String grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        return exmExamPaperItemMapper.selectCount(queryWrapper);
    }
    /**
     * 查询试卷题目信息
     * 分页
     */
    public List<ExmExamPaperItem> selectExmExamPaperItemPage(String id,String paper_id,String item_id,String grade,long current,long size){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        return exmExamPaperItemMapper.selectPage(new Page<ExmExamPaperItem>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询试卷题目信息
     * 列表查询
     */
    public List<ExmExamPaperItem> selectExmExamPaperItemItemList(List<String> id,List<String> paper_id,List<String> item_id,List<String> grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(grade!=null,"grade",grade);
        return exmExamPaperItemMapper.selectList(queryWrapper);
    }
    /**
     * 查询试卷题目信息数量
     * 列表查询
     */
    public long countExmExamPaperItemList(List<String> id,List<String> paper_id,List<String> item_id,List<String> grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(grade!=null,"grade",grade);
        return exmExamPaperItemMapper.selectCount(queryWrapper);
    }
    /**
     * 查询试卷题目信息
     * 列表查询
     * 分页
     */
    public List<ExmExamPaperItem> selectExmExamPaperItemListPage(List<String> id, List<String> paper_id, List<String> item_id, List<String> grade, long current, long size){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(grade!=null,"grade",grade);
        return exmExamPaperItemMapper.selectPage(new Page<ExmExamPaperItem>(current,size),queryWrapper).getRecords();
    }



    /**
     * 查询学生考试关系信息
     */
    public List<ExmExamPermissionRel> selectExmExamPermissionRel(String id,String exam_id,String permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(permission_id),"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生考试关系信息数量
     */
    public long countExmExamPermissionRel(String id,String exam_id,String permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(permission_id),"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生考试关系信息
     * 分页
     */
    public List<ExmExamPermissionRel> selectExmExamPermissionRelPage(String id,String exam_id,String permission_id,long current,long size){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(permission_id),"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectPage(new Page<ExmExamPermissionRel>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询学生考试关系信息
     * 列表查询
     */
    public List<ExmExamPermissionRel> selectExmExamPermissionRelItemList(List<String> id,List<String> exam_id,List<String> permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(permission_id!=null,"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生考试关系信息数量
     * 列表查询
     */
    public long countExmExamPermissionRelList(List<String> id,List<String> exam_id,List<String> permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(permission_id!=null,"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生考试关系信息
     * 列表查询
     * 分页
     */
    public List<ExmExamPermissionRel> selectExmExamPermissionRelListPage(List<String> id, List<String> exam_id, List<String> permission_id, long current, long size){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(permission_id!=null,"permission_id",permission_id);
        return exmExamPermissionRelMapper.selectPage(new Page<ExmExamPermissionRel>(current,size),queryWrapper).getRecords();
    }




    /**
     * 查询学生答案记录信息
     */
    public List<ExmStuPaperItem> selectExmStuPaperItem(String id,String item_id,String item_content,String item_grade,String paper_id,String stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(item_content),"item_content",item_content);
        queryWrapper.in(!StringUtils.isEmpty(item_grade),"item_grade",item_grade);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperItemMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生答案记录信息数量
     */
    public long countExmStuPaperItem(String id,String item_id,String item_content,String item_grade,String paper_id,String stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(item_content),"item_content",item_content);
        queryWrapper.in(!StringUtils.isEmpty(item_grade),"item_grade",item_grade);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperItemMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生答案记录信息
     * 分页
     */
    public List<ExmStuPaperItem> selectExmStuPaperItemPage(String id,String item_id,String item_content,String item_grade,String paper_id,String stu_id,long current,long size){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(item_content),"item_content",item_content);
        queryWrapper.in(!StringUtils.isEmpty(item_grade),"item_grade",item_grade);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperItemMapper.selectPage(new Page<ExmStuPaperItem>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询学生答案记录信息
     * 列表查询
     */
    public List<ExmStuPaperItem> selectExmStuPaperItemList(List<String> id,List<String> item_id,List<String> item_content,List<String> item_grade,List<String> paper_id,List<String> stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(item_content!=null,"item_content",item_content);
        queryWrapper.in(item_grade!=null,"item_grade",item_grade);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperItemMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生答案记录信息数量
     * 列表查询
     */
    public long countExmStuPaperItemList(List<String> id,List<String> item_id,List<String> item_content,List<String> item_grade,List<String> paper_id,List<String> stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(item_content!=null,"item_content",item_content);
        queryWrapper.in(item_grade!=null,"item_grade",item_grade);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperItemMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生答案记录信息
     * 列表查询
     * 分页
     */
    public List<ExmStuPaperItem> selectExmStuPaperItemListPage(List<String> id,List<String> item_id,List<String> item_content,List<String> item_grade,List<String> paper_id,List<String> stu_id,long current,long size){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(item_content!=null,"item_content",item_content);
        queryWrapper.in(item_grade!=null,"item_grade",item_grade);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperItemMapper.selectPage(new Page<ExmStuPaperItem>(current,size),queryWrapper).getRecords();
    }



    /**
     * 查询学生试卷关系信息
     */
    public List<ExmStuPaperRel> selectExmStuPaperRel(String id,String paper_id,String grade,String stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperRelMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生试卷关系信息数量
     */
    public long countExmStuPaperRel(String id,String paper_id,String grade,String stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperRelMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生试卷关系信息
     * 分页
     */
    public List<ExmStuPaperRel> selectExmStuPaperRelPage(String id,String paper_id,String grade,String stu_id,long current,long size){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        return exmStuPaperRelMapper.selectPage(new Page<ExmStuPaperRel>(current,size),queryWrapper).getRecords();
    }
    /**
     * 查询学生试卷关系信息
     * 列表查询
     */
    public List<ExmStuPaperRel> selectExmStuPaperRelItemList(List<String> id,List<String> paper_id,List<String> grade,List<String> stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(grade!=null,"grade",grade);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperRelMapper.selectList(queryWrapper);
    }
    /**
     * 查询学生试卷关系信息数量
     * 列表查询
     */
    public long countExmStuPaperRelList(List<String> id,List<String> paper_id,List<String> grade,List<String> stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(grade!=null,"grade",grade);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperRelMapper.selectCount(queryWrapper);
    }
    /**
     * 查询学生试卷关系信息
     * 列表查询
     * 分页
     */
    public List<ExmStuPaperRel> selectExmStuPaperRelListPage(List<String> id, List<String> paper_id, List<String> grade, List<String> stu_id, long current, long size){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(grade!=null,"grade",grade);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        return exmStuPaperRelMapper.selectPage(new Page<ExmStuPaperRel>(current,size),queryWrapper).getRecords();
    }

    /**
     * ===================================================================================================
     * 基础删除
     * ===================================================================================================
     */

    /**
     * 删除考试信息
     */
    public boolean delExmExam(String id,String exam_name,String subject,String create_id,String create_time,String start_time,String end_time,String exam_type,String exam_precaution,String del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_name),"exam_name",exam_name);
        queryWrapper.in(!StringUtils.isEmpty(subject),"subject",subject);
        queryWrapper.in(!StringUtils.isEmpty(create_id),"create_id",create_id);
        queryWrapper.in(!StringUtils.isEmpty(create_time),"create_time",create_time);
        queryWrapper.in(!StringUtils.isEmpty(start_time),"start_time",start_time);
        queryWrapper.in(!StringUtils.isEmpty(end_time),"end_time",end_time);
        queryWrapper.in(!StringUtils.isEmpty(exam_type),"exam_type",exam_type);
        queryWrapper.in(!StringUtils.isEmpty(exam_precaution),"exam_precaution",exam_precaution);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        exmExamMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除考试信息
     * 列表删除
     */
    public boolean delExmExamList(List<String> id,List<String> exam_name,List<String> subject,List<String> create_id,List<String> create_time,List<String> start_time,List<String> end_time,List<String> exam_type,List<String> exam_precaution,List<String> del_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_name!=null,"exam_name",exam_name);
        queryWrapper.in(subject!=null,"subject",subject);
        queryWrapper.in(create_id!=null,"create_id",create_id);
        queryWrapper.in(create_time!=null,"create_time",create_time);
        queryWrapper.in(start_time!=null,"start_time",start_time);
        queryWrapper.in(end_time!=null,"end_time",end_time);
        queryWrapper.in(exam_type!=null,"exam_type",exam_type);
        queryWrapper.in(exam_precaution!=null,"exam_precaution",exam_precaution);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        exmExamMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除试卷信息
     */
    public boolean delExmExamPaper(String id,String exam_id,String paper_name,String del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(paper_name),"paper_name",paper_name);
        queryWrapper.in(!StringUtils.isEmpty(del_flag),"del_flag",del_flag);
        exmExamPaperMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除试卷信息
     * 列表删除
     */
    public boolean delExmExamPaperList(List<String> id,List<String> exam_id,List<String> paper_name,List<String> del_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(paper_name!=null,"paper_name",paper_name);
        queryWrapper.in(del_flag!=null,"del_flag",del_flag);
        exmExamPaperMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除试卷题目信息
     */
    public boolean delExmExamPaperItem(String id,String paper_id,String item_id,String grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        exmExamPaperItemMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除试卷题目信息
     * 列表删除
     */
    public boolean delExmExamPaperItemList(List<String> id,List<String> paper_id,List<String> item_id,List<String> grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(grade!=null,"grade",grade);
        exmExamPaperItemMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生考试关系信息
     */
    public boolean delExmExamPermissionRel(String id,String exam_id,String permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(permission_id),"permission_id",permission_id);
        exmExamPermissionRelMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生考试关系信息
     * 列表删除
     */
    public boolean delExmExamPermissionRelList(List<String> id,List<String> exam_id,List<String> permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(permission_id!=null,"permission_id",permission_id);
        exmExamPermissionRelMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生答案记录信息
     */
    public boolean delExmStuPaperItem(String id,String item_id,String item_content,String item_grade,String paper_id,String stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(item_content),"item_content",item_content);
        queryWrapper.in(!StringUtils.isEmpty(item_grade),"item_grade",item_grade);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        exmStuPaperItemMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生答案记录信息
     * 列表删除
     */
    public boolean delExmStuPaperItemList(List<String> id,List<String> item_id,List<String> item_content,List<String> item_grade,List<String> paper_id,List<String> stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(item_content!=null,"item_content",item_content);
        queryWrapper.in(item_grade!=null,"item_grade",item_grade);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        exmStuPaperItemMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生试卷关系信息
     */
    public boolean delExmStuPaperRel(String id,String paper_id,String grade,String stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        exmStuPaperRelMapper.delete(queryWrapper);
        return true;
    }
    /**
     * 删除学生试卷关系信息
     * 列表删除
     */
    public boolean delExmStuPaperRelList(List<String> id,List<String> paper_id,List<String> grade,List<String> stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(grade!=null,"grade",grade);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        exmStuPaperRelMapper.delete(queryWrapper);
        return true;
    }

    /**
     * 逻辑删除
     * true:不删除
     * flase：删除
     */
    public boolean logicDelExam(String id,boolean b){
        UpdateWrapper updateWrapper = new UpdateWrapper();
        updateWrapper.eq("id",id);
        if(b){
            updateWrapper.set("del_flag","1");
        }else {
            updateWrapper.set("del_flag","0");
        }
        exmExamMapper.update(null,updateWrapper);
        return true;
    }

    /**
     * 逻辑删除
     * true:不删除
     * flase：删除
     */
    public boolean logicDelPaper(String id,boolean b){
        UpdateWrapper updateWrapper = new UpdateWrapper();
        updateWrapper.eq("id",id);
        if(b){
            updateWrapper.set("del_flag","1");
        }else {
            updateWrapper.set("del_flag","0");
        }
        exmExamPaperMapper.update(null,updateWrapper);
        return true;
    }


    /**
     * ===================================================================================================
     * 基础更新
     * ===================================================================================================
     */



    /**
     * 更新考试信息
     */
    public boolean updateExmExam(String id,String exam_name,String subject,String create_id,String create_time,String start_time,String end_time,String exam_type,String exam_precaution,String update_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_name),"exam_name",exam_name);
        queryWrapper.in(!StringUtils.isEmpty(subject),"subject",subject);
        queryWrapper.in(!StringUtils.isEmpty(create_id),"create_id",create_id);
        queryWrapper.in(!StringUtils.isEmpty(create_time),"create_time",create_time);
        queryWrapper.in(!StringUtils.isEmpty(start_time),"start_time",start_time);
        queryWrapper.in(!StringUtils.isEmpty(end_time),"end_time",end_time);
        queryWrapper.in(!StringUtils.isEmpty(exam_type),"exam_type",exam_type);
        queryWrapper.in(!StringUtils.isEmpty(exam_precaution),"exam_precaution",exam_precaution);
        queryWrapper.in(!StringUtils.isEmpty(update_flag),"update_flag",update_flag);
        exmExamMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新考试信息
     * 列表更新
     */
    public boolean updateExmExamList(List<String> id,List<String> exam_name,List<String> subject,List<String> create_id,List<String> create_time,List<String> start_time,List<String> end_time,List<String> exam_type,List<String> exam_precaution,List<String> update_flag){
        QueryWrapper<ExmExam> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_name!=null,"exam_name",exam_name);
        queryWrapper.in(subject!=null,"subject",subject);
        queryWrapper.in(create_id!=null,"create_id",create_id);
        queryWrapper.in(create_time!=null,"create_time",create_time);
        queryWrapper.in(start_time!=null,"start_time",start_time);
        queryWrapper.in(end_time!=null,"end_time",end_time);
        queryWrapper.in(exam_type!=null,"exam_type",exam_type);
        queryWrapper.in(exam_precaution!=null,"exam_precaution",exam_precaution);
        queryWrapper.in(update_flag!=null,"update_flag",update_flag);
        exmExamMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新试卷信息
     */
    public boolean updateExmExamPaper(String id,String exam_id,String paper_name,String update_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(paper_name),"paper_name",paper_name);
        queryWrapper.in(!StringUtils.isEmpty(update_flag),"update_flag",update_flag);
        exmExamPaperMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新试卷信息
     * 列表更新
     */
    public boolean updateExmExamPaperList(List<String> id,List<String> exam_id,List<String> paper_name,List<String> update_flag){
        QueryWrapper<ExmExamPaper> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(paper_name!=null,"paper_name",paper_name);
        queryWrapper.in(update_flag!=null,"update_flag",update_flag);
        exmExamPaperMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新试卷题目信息
     */
    public boolean updateExmExamPaperItem(String id,String paper_id,String item_id,String grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        exmExamPaperItemMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新试卷题目信息
     * 列表更新
     */
    public boolean updateExmExamPaperItemList(List<String> id,List<String> paper_id,List<String> item_id,List<String> grade){
        QueryWrapper<ExmExamPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(grade!=null,"grade",grade);
        exmExamPaperItemMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生考试关系信息
     */
    public boolean updateExmExamPermissionRel(String id,String exam_id,String permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(exam_id),"exam_id",exam_id);
        queryWrapper.in(!StringUtils.isEmpty(permission_id),"permission_id",permission_id);
        exmExamPermissionRelMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生考试关系信息
     * 列表更新
     */
    public boolean updateExmExamPermissionRelList(List<String> id,List<String> exam_id,List<String> permission_id){
        QueryWrapper<ExmExamPermissionRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(exam_id!=null,"exam_id",exam_id);
        queryWrapper.in(permission_id!=null,"permission_id",permission_id);
        exmExamPermissionRelMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生答案记录信息
     */
    public boolean updateExmStuPaperItem(String id,String item_id,String item_content,String item_grade,String paper_id,String stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(item_id),"item_id",item_id);
        queryWrapper.in(!StringUtils.isEmpty(item_content),"item_content",item_content);
        queryWrapper.in(!StringUtils.isEmpty(item_grade),"item_grade",item_grade);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        exmStuPaperItemMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生答案记录信息
     * 列表更新
     */
    public boolean updateExmStuPaperItemList(List<String> id,List<String> item_id,List<String> item_content,List<String> item_grade,List<String> paper_id,List<String> stu_id){
        QueryWrapper<ExmStuPaperItem> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(item_id!=null,"item_id",item_id);
        queryWrapper.in(item_content!=null,"item_content",item_content);
        queryWrapper.in(item_grade!=null,"item_grade",item_grade);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        exmStuPaperItemMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生试卷关系信息
     */
    public boolean updateExmStuPaperRel(String id,String paper_id,String grade,String stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(!StringUtils.isEmpty(id),"id",id);
        queryWrapper.in(!StringUtils.isEmpty(paper_id),"paper_id",paper_id);
        queryWrapper.in(!StringUtils.isEmpty(grade),"grade",grade);
        queryWrapper.in(!StringUtils.isEmpty(stu_id),"stu_id",stu_id);
        exmStuPaperRelMapper.update(null,queryWrapper);
        return true;
    }
    /**
     * 更新学生试卷关系信息
     * 列表更新
     */
    public boolean updateExmStuPaperRelList(List<String> id,List<String> paper_id,List<String> grade,List<String> stu_id){
        QueryWrapper<ExmStuPaperRel> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(id!=null,"id",id);
        queryWrapper.in(paper_id!=null,"paper_id",paper_id);
        queryWrapper.in(grade!=null,"grade",grade);
        queryWrapper.in(stu_id!=null,"stu_id",stu_id);
        exmStuPaperRelMapper.update(null,queryWrapper);
        return true;
    }

    /**
     * ===================================================================================================
     * 基础新增
     * ===================================================================================================
     */

    /**
     * 增加考试信息
     */
    public boolean insertExam(ExmExam exmExam){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmExam.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmExamMapper.insert(exmExam);
        return true;
    }

    /**
     * 批量
     * 增加考试信息
     * 需要随便向pojo中输入一个id
     */
    public int insertExamList(List<ExmExam> exmExams){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmExams.size();i++){
            exmExams.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmExamMapper.insertBatchSomeColumn(exmExams);
    }

    /**
     * 增加考试试卷信息
     */
    public boolean insertExamPaper(ExmExamPaper exmExamPaper){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmExamPaper.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmExamPaperMapper.insert(exmExamPaper);
        return true;
    }

    /**
     * 批量
     * 增加考试试卷信息
     * 需要随便向pojo中输入一个id
     */
    public int insertExamPaperList(List<ExmExamPaper> exmExamPapers){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmExamPapers.size();i++){
            exmExamPapers.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmExamPaperMapper.insertBatchSomeColumn(exmExamPapers);
    }

    /**
     * 增加考试试卷题目信息
     */
    public boolean insertExamPaperItem(ExmExamPaperItem exmExamPaperItem){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmExamPaperItem.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmExamPaperItemMapper.insert(exmExamPaperItem);
        return true;
    }

    /**
     * 批量
     * 增加考试试卷题目信息
     * 需要随便向pojo中输入一个id
     */
    public int insertExamPaperItemList(List<ExmExamPaperItem> exmExamPaperItems){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmExamPaperItems.size();i++){
            exmExamPaperItems.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmExamPaperItemMapper.insertBatchSomeColumn(exmExamPaperItems);
    }

    /**
     * 增加考试组织关系
     */
    public boolean insertExamPermissionRel(ExmExamPermissionRel exmExamPermissionRel){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmExamPermissionRel.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmExamPermissionRelMapper.insert(exmExamPermissionRel);
        return true;
    }

    /**
     * 批量
     * 增加考试组织关系
     * 需要随便向pojo中输入一个id
     */
    public int insertExamPermissionRelList(List<ExmExamPermissionRel> exmExamPermissionRels){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmExamPermissionRels.size();i++){
            exmExamPermissionRels.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmExamPermissionRelMapper.insertBatchSomeColumn(exmExamPermissionRels);
    }

    /**
     * 增加学生试卷信息
     */
    public boolean insertStuPaperItem(ExmStuPaperItem exmStuPaperItem){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmStuPaperItem.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmStuPaperItemMapper.insert(exmStuPaperItem);
        return true;
    }

    /**
     * 批量
     * 增加学生试卷信息
     * 需要随便向pojo中输入一个id
     */
    public int insertStuPaperItemList(List<ExmStuPaperItem> exmStuPaperItems){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmStuPaperItems.size();i++){
            exmStuPaperItems.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmStuPaperItemMapper.insertBatchSomeColumn(exmStuPaperItems);
    }

    /**
     * 增加学生试卷关系
     */
    public boolean insertStuPaperRel(ExmStuPaperRel exmStuPaperRel){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        exmStuPaperRel.setId(String.valueOf(snowflakeIdWorker.nextId()));
        exmStuPaperRelMapper.insert(exmStuPaperRel);
        return true;
    }

    /**
     * 批量
     * 增加学生试卷关系
     * 需要随便向pojo中输入一个id
     */
    public int insertStuPaperRelList(List<ExmStuPaperRel> exmStuPaperRels){
        SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker();
        for (int i=0;i<exmStuPaperRels.size();i++){
            exmStuPaperRels.get(i).setId(String.valueOf(snowflakeIdWorker.nextId()));
        }
        return exmStuPaperRelMapper.insertBatchSomeColumn(exmStuPaperRels);
    }
}
